<template>
  <div class="mod-oss__oss">
    <!-- 弹窗, 云存储配置 -->
    <config ref="configRef"></config>
    <!-- 弹窗, 上传文件 -->
    <!-- <upload v-if="state.uploadVisible" ref="uploadRef" @refreshDataList="state.getDataList"></upload> -->
  </div>
</template>

<script lang="ts" setup>
import useView from "@/hooks/useView";
import { nextTick, reactive, ref, toRefs, onMounted } from "vue";
import Config from "./oss-config.vue";
import Upload from "./oss-upload.vue";

const configRef = ref();
const uploadRef = ref();

const view = reactive({
  getDataListURL: "/sys/oss/page",
  getDataListIsPage: true,
  deleteURL: "/sys/oss",
  deleteIsBatch: true,
  dataForm: {},
  uploadVisible: false
});

const state = reactive({ ...useView(view), ...toRefs(view) });

// 云存储配置
const configHandle = () => {
  nextTick(() => {
    configRef.value.init();
  });
};

// // 上传文件
// const uploadHandle = () => {
//   state.uploadVisible = true;
//   nextTick(() => {
//     uploadRef.value.init();
//   });
// };

onMounted(() => {
  configHandle();
});
</script>
